package test.work.vo;

import java.io.Serializable;

public class Department implements Serializable, Comparable<Department> {
	private int deptNum;
	private String deptName;
	private int floor;
	
	
	public Department(int deptNum, String deptName) {
		this.deptNum = deptNum;
		this.deptName = deptName;
	}

	public Department(int deptNum, String deptName, int floor) {
		this.deptNum = deptNum;
		this.deptName = deptName;
		this.floor = floor;	
	}

	@Override
	public String toString() {
		return String.format("%3s\t%5s\t%3s",
				deptNum, deptName, floor);
	}

	public int getDeptNum() {
		return deptNum;
	}

	public void setDeptNum(int deptNum) {
		this.deptNum = deptNum;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public int getFloor() {
		return floor;
	}

	public void setFloor(int floor) {
		this.floor = floor;
	}

	@Override
	public boolean equals(Object obj) {
		boolean result=false;
		if(obj instanceof Department){
			Department temp = (Department)obj;
			result=deptNum==temp.deptNum&&deptName.equals(temp.deptName);
		}
		return result;
	}

	@Override
	public int compareTo(Department o) {
		return deptNum-o.deptNum;
	}
}
